package com.jrx.anytxn.investor.timer.job.transfer.step;


import com.jrx.anytxn.investor.constant.TransBizConstant;
import com.jrx.anytxn.investor.entity.TlFundTransferLog;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisCursorItemReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * 转账reader
 *
 * @author jxy
 */
public class TransferReader extends MyBatisCursorItemReader<TlFundTransferLog> {

    private static final Logger logger = LoggerFactory.getLogger(TransferReader.class);


    public TransferReader(SqlSessionFactory sqlSessionFactory){
        setSaveState(false);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.investor.mapper.ext.ExtTlFundTransferLogMapper.selectByTypeStatusForBatch");

        Map<String, Object> map = new HashMap<>();
        map.put("sumStatus", TransBizConstant.TRANSFER_SUM_STATUS_D);
        map.put("transferType", TransBizConstant.TRANSFER_TYPE_3);
        setParameterValues(map);
    }
}
